<template>
	<view>
		<view style="height: 120rpx"></view>
		<view class="tabbarbox">
			<view class="taritem" v-for="(item, index) in list" :key="index" @click="changetar(item, index)">
				<!-- <image :src="index == actbar ? item.imged : item.img"></image> -->
				<!-- <image :src="item.imged"></image> -->
				<image v-if="index==actbar&&actbar==0" src="../static/tar11.png"></image>
				<image v-if="actbar==1&&index==0" src="../static/tar1.png"></image>
				<image v-if="actbar==0&&index==1" src="../static/tar2.png"></image>
				<image v-if="index==actbar&&actbar==1" src="../static/tar22.png"></image>
				<view>{{ item.title }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: "tabbar",
	props: {
		actbar: {
			type: Number,
			default: 0,
		},
	},
	data() {
		return {
			list: [
				{ img: "../static/tar1.png", imged: "../static/tar11.png", title: "首页", path: "/pages/Comactivities/Comactivities" },
				// {img:'../static/tar2.png',imged:'../static/tar22.png',title:'商城',path:'/pages/shop/shop'},
				{ img: "../static/tar3.png", imged: "../static/tar33.png", title: "我的", path: "/pages/my/my" },
			],
		}
	},
	methods: {
		changetar(item, index) {
			console.log(this.actbar, index)
			// uni.switchTab({
			// 	url: item.path,
			// })
			uni.navigateTo({
				url: item.path,
			})
			// if(index==1){
			// 	uni.showToast({
			// 		title:'正在快马加鞭开发中',
			// 		icon:'none'
			// 	})
			// }else{
			// 	uni.switchTab({
			// 		url: item.path
			// 	})
			// }

			// this.actbar = index
		},
	},
}
</script>

<style lang="scss" scoped>
.tabbarbox {
	width: 750rpx;
	height: 110rpx;
	background: url( "https://mtang.zxkjnc.com/bg3.png") no-repeat;
	background-size: 750rpx 110rpx;
	position: fixed;
	bottom: 0;
	display: flex;
	z-index: 99;
	
	.taritem {
		width: 50%;
		text-align: center;
		margin-top: -10rpx;
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #ff6178;
		image {
			width: 78rpx;
			height: 80rpx;
		}
	}
}
</style>
